import { Table, Switch,Button } from 'antd';
import React from 'react';
// 状态切换
const onChangeSwitch =(checked)=>{
console.log("checked",checked);
}
const columns = [
    {
      title: '角色编号',
      dataIndex: 'roleIndex',
      key: 'roleIndex',
    },
    {
      title: '角色名称',
      dataIndex: 'roleName',
      key: 'roleName',
    },
    {
      title: '权限字符',
      dataIndex: 'addrPermissionsCharacteress',
      key: 'PermissionsCharacter',
    },
    {
      title: '显示顺序',
      key: 'AccordingOrder',
      dataIndex: 'AccordingOrder',
    },
    {
      title: '状态',
      key: 'state',
      render: (_, record) => (
         <Switch defaultChecked onChange={onChangeSwitch} />
      ),
    },
    {
        title: '创建时间',
        key: 'updataTime',
        dataIndex: 'updataTime',
      },
      {
        title:'操作',
        key:'caozuo',
        render:(_, record)=>(
          <div>
              <Button type="primary">修改</Button>
            <Button style={{marginLeft:20}} type="primary">删除</Button>
           </div>
        )
      }
  ];
  const data = [
    {
      key: '1',
      roleIndex: '1',
      roleName: '超级管理员',
      addrPermissionsCharacteress:'admin',
      AccordingOrder: '1',
      state:'0',
      updataTime: '2022-07-28',
    },
    {
        key: '2',
        roleIndex: '2',
        roleName: '管理员',
        addrPermissionsCharacteress:'user',
        AccordingOrder: '2',
        state:'1',
        updataTime: '2022-07-28',
      },
  ];
export default function TabList( ) {
    return (
      <div style={{margin:20}}>
        <Table columns={columns} dataSource={data} />
      </div>
    )
} 